home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / marionettemadness.swf / scripts / __Packages / com / mosesSupposes / fuse / Fuse.as next >
Text File  |  2007-10-01  |  26KB  |  810 lines

  1. class com.mosesSupposes.fuse.Fuse extends Array
  2. {
  3.    static var registryKey = "fuse";
  4.    static var VERSION = com.mosesSupposes.fuse.FuseKitCommon.VERSION;
  5.    static var OUTPUT_LEVEL = 1;
  6.    static var AUTOCLEAR = false;
  7.    static var AUTOSTOP = true;
  8.    var _nState = -1;
  9.    var _nDelay = -1;
  10.    var _nTimeCache = -1;
  11.    static var _aInstances = null;
  12.    static var _oBuildMode = null;
  13.    function Fuse(action)
  14.    {
  15.       super();
  16.       mx.events.EventDispatcher.initialize(this);
  17.       this._nID = com.mosesSupposes.fuse.Fuse.registerInstance(this);
  18.       this._nState = -1;
  19.       this._aDefaultTargs = new Array();
  20.       if(arguments.length > 0)
  21.       {
  22.          this.splice.apply(this,new Array(0,0).concat(arguments));
  23.       }
  24.       var _loc4_ = ["concat","join","sort","sortOn"];
  25.       for(var _loc5_ in _loc4_)
  26.       {
  27.          com.mosesSupposes.fuse.Fuse.prototype[_loc4_[_loc5_]] = function()
  28.          {
  29.             if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 0)
  30.             {
  31.                com.mosesSupposes.fuse.FuseKitCommon.error("105");
  32.             }
  33.          };
  34.       }
  35.    }
  36.    function addEventListener(event, handler)
  37.    {
  38.    }
  39.    function removeEventListener(event, handler)
  40.    {
  41.    }
  42.    function destroy()
  43.    {
  44.       if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  45.       {
  46.          com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + " destroy.");
  47.       }
  48.       this.stop(true);
  49.       this.splice(0,this.length);
  50.       this._aDefaultTargs = null;
  51.       this.scope = null;
  52.       _global.ASSetPropFlags(this,null,0,7);
  53.       var _loc4_ = this._nID;
  54.       for(var _loc3_ in this)
  55.       {
  56.          delete this[_loc3_];
  57.       }
  58.       com.mosesSupposes.fuse.Fuse.removeInstanceAt(_loc4_,true);
  59.       false;
  60.       false;
  61.    }
  62.    static function getInstance(idOrLabel)
  63.    {
  64.       if(typeof idOrLabel == "number")
  65.       {
  66.          return com.mosesSupposes.fuse.Fuse._aInstances[idOrLabel];
  67.       }
  68.       if(typeof idOrLabel == "string")
  69.       {
  70.          for(var _loc2_ in com.mosesSupposes.fuse.Fuse._aInstances)
  71.          {
  72.             if(com.mosesSupposes.fuse.Fuse(com.mosesSupposes.fuse.Fuse._aInstances[_loc2_]).label == idOrLabel)
  73.             {
  74.                return com.mosesSupposes.fuse.Fuse._aInstances[_loc2_];
  75.             }
  76.          }
  77.       }
  78.       return null;
  79.    }
  80.    static function getInstances(stateFilter, targets)
  81.    {
  82.       var _loc10_ = stateFilter == null || stateFilter.toUpperCase() == "ALL";
  83.       if(!(targets instanceof Array))
  84.       {
  85.          targets = arguments.slice(1);
  86.       }
  87.       var _loc8_ = [];
  88.       for(var _loc11_ in com.mosesSupposes.fuse.Fuse._aInstances)
  89.       {
  90.          var _loc5_ = com.mosesSupposes.fuse.Fuse._aInstances[_loc11_];
  91.          if(com.mosesSupposes.fuse.Fuse._aInstances[_loc11_] != null)
  92.          {
  93.             if(!(_loc10_ == false && _loc5_.__get__state() != stateFilter))
  94.             {
  95.                var _loc3_ = targets.length == 0;
  96.                if(_loc3_ == false)
  97.                {
  98.                   if(_loc3_ == true)
  99.                   {
  100.                      continue;
  101.                   }
  102.                   var _loc2_ = _loc5_.getActiveTargets(true);
  103.                   for(var _loc7_ in targets)
  104.                   {
  105.                      for(var _loc6_ in _loc2_)
  106.                      {
  107.                         if(_loc2_[_loc6_] == targets[_loc7_])
  108.                         {
  109.                            _loc3_ = true;
  110.                            break;
  111.                         }
  112.                      }
  113.                   }
  114.                }
  115.                if(_loc3_ == true)
  116.                {
  117.                   _loc8_.unshift(_loc5_);
  118.                }
  119.             }
  120.          }
  121.       }
  122.       return _loc8_;
  123.    }
  124.    function get id()
  125.    {
  126.       return this._nID;
  127.    }
  128.    function get state()
  129.    {
  130.       switch(this._nState)
  131.       {
  132.          case -1:
  133.             return "stopped";
  134.          case 0:
  135.             return "paused";
  136.          case 1:
  137.             return "playing";
  138.          default:
  139.             return undefined;
  140.       }
  141.    }
  142.    function get currentIndex()
  143.    {
  144.       return this._nIndex;
  145.    }
  146.    function get currentLabel()
  147.    {
  148.       return this[this._nIndex].label;
  149.    }
  150.    function get target()
  151.    {
  152.       return this._aDefaultTargs.length != 1 ? this._aDefaultTargs : this._aDefaultTargs[0];
  153.    }
  154.    function set target(t)
  155.    {
  156.       delete this._aDefaultTargs;
  157.       if(t != null)
  158.       {
  159.          this.addTarget(t);
  160.       }
  161.    }
  162.    function addTarget(t)
  163.    {
  164.       if(this._aDefaultTargs == null)
  165.       {
  166.          this._aDefaultTargs = [];
  167.       }
  168.       if(arguments[0] instanceof Array)
  169.       {
  170.          arguments = arguments[0];
  171.       }
  172.       for(var _loc5_ in arguments)
  173.       {
  174.          var _loc3_ = false;
  175.          for(var _loc4_ in this._aDefaultTargs)
  176.          {
  177.             if(arguments[_loc5_] == this._aDefaultTargs[_loc4_])
  178.             {
  179.                _loc3_ = true;
  180.                break;
  181.             }
  182.          }
  183.          if(_loc3_ == false)
  184.          {
  185.             this._aDefaultTargs.push(arguments[_loc5_]);
  186.          }
  187.       }
  188.    }
  189.    function removeTarget(t)
  190.    {
  191.       if(this._aDefaultTargs == null || this._aDefaultTargs.length == 0)
  192.       {
  193.          return undefined;
  194.       }
  195.       if(arguments[0] instanceof Array)
  196.       {
  197.          arguments = arguments[0];
  198.       }
  199.       for(var _loc4_ in arguments)
  200.       {
  201.          for(var _loc3_ in this._aDefaultTargs)
  202.          {
  203.             if(arguments[_loc4_] == this._aDefaultTargs[_loc3_])
  204.             {
  205.                this._aDefaultTargs.splice(Number(_loc3_),1);
  206.             }
  207.          }
  208.       }
  209.    }
  210.    function getActiveTargets(includeDefaults)
  211.    {
  212.       if(this._nState == -1)
  213.       {
  214.          return [];
  215.       }
  216.       var _loc2_ = undefined;
  217.       if(includeDefaults == true)
  218.       {
  219.          _loc2_ = this._aDefaultTargs.slice();
  220.       }
  221.       else
  222.       {
  223.          _loc2_ = [];
  224.       }
  225.       return com.mosesSupposes.fuse.FuseItem(this[this._nIndex]).getActiveTargets(_loc2_);
  226.    }
  227.    function clone()
  228.    {
  229.       var _loc3_ = [];
  230.       var _loc2_ = 0;
  231.       while(_loc2_ < this.length)
  232.       {
  233.          _loc3_.push(com.mosesSupposes.fuse.FuseItem(this[_loc2_]).getInitObj());
  234.          _loc2_ = _loc2_ + 1;
  235.       }
  236.       var _loc4_ = new com.mosesSupposes.fuse.Fuse();
  237.       _loc4_.push.apply(_loc4_,_loc3_);
  238.       _loc4_.scope = this.scope;
  239.       _loc4_.__set__target(this.target);
  240.       return _loc4_;
  241.    }
  242.    function push()
  243.    {
  244.       this.splice.apply(this,new Array(this.length,0).concat(arguments));
  245.       return this.length;
  246.    }
  247.    function pushTween(targets, props, endvals, seconds, ease, delay, callback)
  248.    {
  249.       this.push({__buildMode:true,tweenargs:arguments});
  250.       return this.length;
  251.    }
  252.    function pop()
  253.    {
  254.       var _loc2_ = com.mosesSupposes.fuse.FuseItem(this[this.length - 1]).getInitObj();
  255.       this.splice(this.length - 1,1);
  256.       return _loc2_;
  257.    }
  258.    function unshift()
  259.    {
  260.       this.splice.apply(this,new Array(0,0).concat(arguments));
  261.       return this.length;
  262.    }
  263.    function shift()
  264.    {
  265.       var _loc2_ = com.mosesSupposes.fuse.FuseItem(this[0]).getInitObj();
  266.       this.splice(0,1);
  267.       return _loc2_;
  268.    }
  269.    function splice(startIndex, deleteCount)
  270.    {
  271.       this.stop(true);
  272.       var _loc7_ = Number(arguments.shift());
  273.       if(_loc7_ < 0)
  274.       {
  275.          _loc7_ = this.length + _loc7_;
  276.       }
  277.       deleteCount = Number(arguments.shift());
  278.       var _loc8_ = new Array();
  279.       var _loc5_ = 0;
  280.       while(_loc5_ < arguments.length)
  281.       {
  282.          var _loc4_ = !(arguments[_loc5_] instanceof com.mosesSupposes.fuse.Fuse) ? new com.mosesSupposes.fuse.FuseItem(_loc7_ + _loc5_,arguments[_loc5_],this._nID) : arguments[_loc5_];
  283.          this.addEventListener("onStop",_loc4_);
  284.          this.addEventListener("evtSetStart",_loc4_);
  285.          _loc8_.push(_loc4_);
  286.          _loc5_ = _loc5_ + 1;
  287.       }
  288.       var _loc6_ = super.splice.apply(this,new Array(_loc7_,deleteCount).concat(_loc8_));
  289.       for(var _loc9_ in _loc6_)
  290.       {
  291.          _loc4_ = _loc6_[_loc9_];
  292.          this.removeEventListener("onStop",_loc4_);
  293.          this.removeEventListener("evtSetStart",_loc4_);
  294.          if(_loc4_ instanceof com.mosesSupposes.fuse.Fuse)
  295.          {
  296.             _loc4_.removeEventListener("onComplete",this._oDel1);
  297.          }
  298.          else
  299.          {
  300.             _loc4_.destroy();
  301.             false;
  302.          }
  303.       }
  304.       _loc5_ = 0;
  305.       while(_loc5_ < this.length)
  306.       {
  307.          com.mosesSupposes.fuse.FuseItem(this[_loc5_])._nItemID = _loc5_;
  308.          _loc5_ = _loc5_ + 1;
  309.       }
  310.    }
  311.    function slice(indexA, indexB)
  312.    {
  313.       var _loc6_ = super.slice(indexA,indexB);
  314.       var _loc5_ = new Array();
  315.       var _loc4_ = 0;
  316.       while(_loc4_ < arguments.length)
  317.       {
  318.          _loc5_.push(com.mosesSupposes.fuse.FuseItem(this[_loc4_]).getInitObj());
  319.          _loc4_ = _loc4_ + 1;
  320.       }
  321.       return _loc5_;
  322.    }
  323.    function reverse()
  324.    {
  325.       this.stop(true);
  326.       super.reverse();
  327.       var _loc3_ = 0;
  328.       while(_loc3_ < this.length)
  329.       {
  330.          com.mosesSupposes.fuse.FuseItem(this[_loc3_])._nItemID = _loc3_;
  331.          _loc3_ = _loc3_ + 1;
  332.       }
  333.    }
  334.    function traceItems(indexA, indexB)
  335.    {
  336.       var _loc5_ = "";
  337.       var _loc4_ = super.slice(indexA,indexB);
  338.       _loc5_ += this.getHandle() + " traceItems:" + "\n----------\n";
  339.       var _loc3_ = 0;
  340.       while(_loc3_ < _loc4_.length)
  341.       {
  342.          if(_loc4_[_loc3_] instanceof com.mosesSupposes.fuse.Fuse)
  343.          {
  344.             _loc5_ += this.getHandle() + ">Item#" + _loc3_ + ": [Nested Fuse] " + _loc4_[_loc3_] + "\n";
  345.          }
  346.          else
  347.          {
  348.             _loc5_ += _loc4_[_loc3_] + "\n";
  349.          }
  350.          _loc3_ = _loc3_ + 1;
  351.       }
  352.       _loc5_ += "----------";
  353.       com.mosesSupposes.fuse.FuseKitCommon.output(_loc5_);
  354.    }
  355.    function toString()
  356.    {
  357.       return this.getHandle() + " (contains " + this.length + (this.length != 1 ? " items)" : " item)");
  358.    }
  359.    function setStartProps(trueOrItemIDs)
  360.    {
  361.       var _loc8_ = arguments.length == 0 || trueOrItemIDs === true || trueOrItemIDs == com.mosesSupposes.fuse.FuseKitCommon.ALL;
  362.       this.dispatchEvent({target:this,type:"evtSetStart",all:_loc8_,filter:(!(trueOrItemIDs instanceof Array) ? arguments : trueOrItemIDs),curIndex:(this._nState != 1 ? -1 : this._nIndex),targs:this._aDefaultTargs,scope:this.scope});
  363.    }
  364.    function start(setStart)
  365.    {
  366.       com.mosesSupposes.fuse.Fuse.close();
  367.       this.stop(true);
  368.       this._nState = 1;
  369.       if(this.length == 0)
  370.       {
  371.          this.advance(false,true,false);
  372.       }
  373.       if(setStart != null && setStart != false)
  374.       {
  375.          this.setStartProps.apply(this,arguments);
  376.       }
  377.       this.dispatchEvent({target:this,type:"onStart"});
  378.       if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  379.       {
  380.          com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + "  start.");
  381.       }
  382.       this.playCurrentItem();
  383.    }
  384.    function stop()
  385.    {
  386.       if(this._nState != -1)
  387.       {
  388.          var _loc3_ = 0;
  389.          while(_loc3_ < this.length)
  390.          {
  391.             if(_loc3_ == this._nIndex || com.mosesSupposes.fuse.FuseItem(this[_loc3_]).hasTriggerFired() == true)
  392.             {
  393.                com.mosesSupposes.fuse.FuseItem(this[_loc3_]).stop();
  394.             }
  395.             _loc3_ = _loc3_ + 1;
  396.          }
  397.       }
  398.       if(this[this._nIndex] instanceof com.mosesSupposes.fuse.Fuse)
  399.       {
  400.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).removeEventListener("onComplete",this._oDel1);
  401.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).stop();
  402.       }
  403.       var _loc4_ = this._nState;
  404.       this._nState = -1;
  405.       if(arguments[0] !== true && _loc4_ != -1)
  406.       {
  407.          this.dispatchEvent({target:this,type:"onStop"});
  408.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  409.          {
  410.             com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + "  stop.");
  411.          }
  412.       }
  413.       this._nIndex = 0;
  414.       clearInterval(this._nDelay);
  415.       this._nTimeCache = this._nDelay = -1;
  416.    }
  417.    function skipTo(indexOrLabel)
  418.    {
  419.       com.mosesSupposes.fuse.Fuse.close();
  420.       var _loc3_ = this.normalizeIndex(indexOrLabel);
  421.       if(_loc3_ == null)
  422.       {
  423.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 0)
  424.          {
  425.             com.mosesSupposes.fuse.FuseKitCommon.error("102","skipTo",String(indexOrLabel));
  426.          }
  427.          return undefined;
  428.       }
  429.       if(_loc3_ == this._nIndex && arguments[1] === true)
  430.       {
  431.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 0)
  432.          {
  433.             com.mosesSupposes.fuse.FuseKitCommon.error("103",String(indexOrLabel),this._nIndex);
  434.          }
  435.       }
  436.       if(this[this._nIndex] instanceof com.mosesSupposes.fuse.Fuse)
  437.       {
  438.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).removeEventListener("onComplete",this._oDel1);
  439.       }
  440.       com.mosesSupposes.fuse.FuseItem(this[this._nIndex]).stop();
  441.       this._nIndex = _loc3_;
  442.       var _loc4_ = this._nState;
  443.       this._nState = 1;
  444.       if(_loc4_ == -1)
  445.       {
  446.          this.dispatchEvent({target:this,type:"onStart"});
  447.       }
  448.       this.playCurrentItem();
  449.       if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  450.       {
  451.          com.mosesSupposes.fuse.FuseKitCommon.output("skipTo:" + _loc3_);
  452.       }
  453.    }
  454.    function pause()
  455.    {
  456.       if(this._nState == 1)
  457.       {
  458.          this[this._nIndex].pause();
  459.          if(this._nTimeCache != -1)
  460.          {
  461.             this._nTimeCache -= getTimer();
  462.             clearInterval(this._nDelay);
  463.          }
  464.          this._nState = 0;
  465.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  466.          {
  467.             com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + "  pause.");
  468.          }
  469.          this.dispatchEvent({target:this,type:"onPause"});
  470.       }
  471.    }
  472.    function resume()
  473.    {
  474.       if(this._nState != 0)
  475.       {
  476.          return undefined;
  477.       }
  478.       com.mosesSupposes.fuse.Fuse.close();
  479.       this._nState = 1;
  480.       if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  481.       {
  482.          com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + "  resume.");
  483.       }
  484.       this.dispatchEvent({target:this,type:"onResume"});
  485.       if(this._nTimeCache != -1)
  486.       {
  487.          clearInterval(this._nDelay);
  488.          this._nTimeCache = getTimer() + this._nTimeCache;
  489.          this._nDelay = setInterval(mx.utils.Delegate.create(this,this.playCurrentItem),this._nTimeCache,true);
  490.       }
  491.       if(this[this._nIndex] instanceof com.mosesSupposes.fuse.Fuse)
  492.       {
  493.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).resume();
  494.       }
  495.       else
  496.       {
  497.          com.mosesSupposes.fuse.FuseItem(this[this._nIndex]).pause(true);
  498.       }
  499.    }
  500.    function fastForward(resumeAtIndexOrLabel)
  501.    {
  502.       var _loc3_ = resumeAtIndexOrLabel != null ? this.normalizeIndex(resumeAtIndexOrLabel) : this.length;
  503.       if(_loc3_ == null)
  504.       {
  505.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 0)
  506.          {
  507.             com.mosesSupposes.fuse.FuseKitCommon.error("102","fastForward",String(resumeAtIndexOrLabel));
  508.          }
  509.          return undefined;
  510.       }
  511.       if(_loc3_ == 0 || _loc3_ <= this._nIndex)
  512.       {
  513.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 0)
  514.          {
  515.             com.mosesSupposes.fuse.FuseKitCommon.error("104",_loc3_);
  516.          }
  517.          this.skipTo(_loc3_);
  518.          return undefined;
  519.       }
  520.       clearInterval(this._nDelay);
  521.       var _loc2_ = this._nIndex;
  522.       while(_loc2_ < _loc3_)
  523.       {
  524.          this[_loc2_].fastForward(null,this._aDefaultTargs,this.scope);
  525.          this.advance(false,true,!(_loc2_ == _loc3_ - 1 && _loc3_ < this.length));
  526.          _loc2_ = _loc2_ + 1;
  527.       }
  528.    }
  529.    function getHandle()
  530.    {
  531.       return "-Fuse" + (this.label == undefined ? "#" + String(this._nID) : " \"" + this.label + "\"");
  532.    }
  533.    function advance(wasTriggered, silentStop, isFF)
  534.    {
  535.       var _loc3_ = false;
  536.       if(this._nIndex == this.length - 1 && isFF != true)
  537.       {
  538.          var _loc2_ = this.length - 1;
  539.          while(_loc2_ > -1)
  540.          {
  541.             if(com.mosesSupposes.fuse.FuseItem(this[_loc2_])._nPlaying > -1)
  542.             {
  543.                return undefined;
  544.             }
  545.             _loc2_ = _loc2_ - 1;
  546.          }
  547.          _loc3_ = true;
  548.       }
  549.       if(wasTriggered == true && _loc3_ == false)
  550.       {
  551.          return undefined;
  552.       }
  553.       if(this[this._nIndex] instanceof com.mosesSupposes.fuse.Fuse)
  554.       {
  555.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).removeEventListener("onComplete",this._oDel1);
  556.       }
  557.       if(++this._nIndex >= this.length)
  558.       {
  559.          this.stop(silentStop);
  560.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  561.          {
  562.             com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + " complete.");
  563.          }
  564.          this.dispatchEvent({target:this,type:"onComplete"});
  565.          if(this.autoClear == true || this.autoClear !== false && com.mosesSupposes.fuse.Fuse.AUTOCLEAR == true)
  566.          {
  567.             this.destroy();
  568.          }
  569.          return undefined;
  570.       }
  571.       if(isFF == true)
  572.       {
  573.          return undefined;
  574.       }
  575.       if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  576.       {
  577.          com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + " advance: " + this._nIndex);
  578.       }
  579.       this.dispatchEvent({target:this,type:"onAdvance"});
  580.       this.playCurrentItem();
  581.    }
  582.    function playCurrentItem(postDelay)
  583.    {
  584.       clearInterval(this._nDelay);
  585.       if(postDelay !== true)
  586.       {
  587.          var _loc4_ = com.mosesSupposes.fuse.FuseItem(this[this._nIndex]).evalDelay(this.scope) || 0;
  588.          if(_loc4_ > 0)
  589.          {
  590.             var _loc3_ = Math.abs(_global.com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER);
  591.             if(_global.isNaN(_loc3_) == true)
  592.             {
  593.                _loc3_ = 1;
  594.             }
  595.             this._nTimeCache = getTimer() + _loc4_ * 1000 * _loc3_;
  596.             this._nDelay = setInterval(mx.utils.Delegate.create(this,this.playCurrentItem),_loc4_ * 1000 * _loc3_,true);
  597.             return undefined;
  598.          }
  599.       }
  600.       this._nTimeCache = this._nDelay = -1;
  601.       if(this[this._nIndex] instanceof com.mosesSupposes.fuse.Fuse)
  602.       {
  603.          if(this._oDel1 == null)
  604.          {
  605.             this._oDel1 = mx.utils.Delegate.create(this,this.advance);
  606.          }
  607.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).addEventListener("onComplete",this._oDel1);
  608.          com.mosesSupposes.fuse.Fuse(this[this._nIndex]).start(this._aDefaultTargs,this.scope);
  609.       }
  610.       else
  611.       {
  612.          var _loc5_ = com.mosesSupposes.fuse.FuseItem(this[this._nIndex]).startItem(this._aDefaultTargs,this.scope,this.duration,this.easing);
  613.          if(com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL > 1)
  614.          {
  615.             com.mosesSupposes.fuse.FuseKitCommon.output(this.getHandle() + " props tweened: " + _loc5_);
  616.          }
  617.       }
  618.    }
  619.    function evtSetStart(o)
  620.    {
  621.       this.setStartProps.apply(this,o.filter);
  622.    }
  623.    static function open(fuseOrID)
  624.    {
  625.       var _loc3_ = _global.com.mosesSupposes.fuse.ZigoEngine;
  626.       if(_loc3_ == undefined)
  627.       {
  628.          com.mosesSupposes.fuse.FuseKitCommon.error("106");
  629.          return null;
  630.       }
  631.       _loc3_.register(com.mosesSupposes.fuse.Fuse,com.mosesSupposes.fuse.FuseItem);
  632.       if(com.mosesSupposes.fuse.Fuse._oBuildMode == null)
  633.       {
  634.          com.mosesSupposes.fuse.Fuse._oBuildMode = {curID:-1,prevID:-1,curGroup:null};
  635.       }
  636.       else if(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1)
  637.       {
  638.          com.mosesSupposes.fuse.Fuse.close();
  639.       }
  640.       if(fuseOrID != null)
  641.       {
  642.          if(fuseOrID instanceof com.mosesSupposes.fuse.Fuse)
  643.          {
  644.             com.mosesSupposes.fuse.Fuse._oBuildMode.curID = fuseOrID.id;
  645.          }
  646.          else
  647.          {
  648.             if(com.mosesSupposes.fuse.Fuse.getInstance(fuseOrID) == null)
  649.             {
  650.                com.mosesSupposes.fuse.FuseKitCommon.error("107");
  651.                return null;
  652.             }
  653.             com.mosesSupposes.fuse.Fuse._oBuildMode.curID = com.mosesSupposes.fuse.Fuse.getInstance(fuseOrID).id;
  654.          }
  655.       }
  656.       else
  657.       {
  658.          com.mosesSupposes.fuse.Fuse._oBuildMode.curID = new com.mosesSupposes.fuse.Fuse().id;
  659.       }
  660.       com.mosesSupposes.fuse.Fuse._oBuildMode.prevID = com.mosesSupposes.fuse.Fuse._oBuildMode.curID;
  661.       return com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.curID);
  662.    }
  663.    static function openGroup(fuseOrID)
  664.    {
  665.       if(!(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1))
  666.       {
  667.          com.mosesSupposes.fuse.Fuse.open(fuseOrID);
  668.       }
  669.       else if(com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup != null)
  670.       {
  671.          com.mosesSupposes.fuse.Fuse.closeGroup();
  672.       }
  673.       com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup = new Array();
  674.       return com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.curID);
  675.    }
  676.    static function closeGroup()
  677.    {
  678.       if(com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup == null || !(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1))
  679.       {
  680.          return undefined;
  681.       }
  682.       com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.curID).push(com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup);
  683.       com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup = null;
  684.    }
  685.    static function close()
  686.    {
  687.       if(!(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1))
  688.       {
  689.          return undefined;
  690.       }
  691.       if(com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup != null)
  692.       {
  693.          com.mosesSupposes.fuse.Fuse.closeGroup();
  694.       }
  695.       com.mosesSupposes.fuse.Fuse._oBuildMode.curID = -1;
  696.    }
  697.    static function closeAndStart(setStart)
  698.    {
  699.       if(!(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1))
  700.       {
  701.          return undefined;
  702.       }
  703.       var _loc2_ = com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.curID);
  704.       com.mosesSupposes.fuse.Fuse.close();
  705.       _loc2_.start.apply(_loc2_,arguments);
  706.    }
  707.    static function startRecent(setStart)
  708.    {
  709.       var _loc2_ = com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.prevID);
  710.       if(_loc2_ != null)
  711.       {
  712.          _loc2_.start.apply(_loc2_,arguments);
  713.       }
  714.       else
  715.       {
  716.          com.mosesSupposes.fuse.FuseKitCommon.error("108");
  717.       }
  718.    }
  719.    static function addCommand(commandOrScope, indexOrFunc, argument)
  720.    {
  721.       if(!(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1))
  722.       {
  723.          return undefined;
  724.       }
  725.       var _loc4_ = com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup != null;
  726.       var _loc2_ = _loc4_ != true ? com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.curID) : com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup;
  727.       if(typeof commandOrScope == "string")
  728.       {
  729.          var _loc7_ = indexOrFunc != undefined;
  730.          var _loc5_ = com.mosesSupposes.fuse.FuseKitCommon._validateFuseCommand(String(commandOrScope),_loc4_,_loc7_,com.mosesSupposes.fuse.Fuse.OUTPUT_LEVEL,true);
  731.          if(_loc5_ == true)
  732.          {
  733.             _loc2_.push({__buildMode:true,command:commandOrScope,commandargs:indexOrFunc});
  734.          }
  735.       }
  736.       else
  737.       {
  738.          _loc2_.push({__buildMode:true,scope:commandOrScope,func:indexOrFunc,args:arguments.slice(2)});
  739.       }
  740.    }
  741.    static function addBuildItem(args)
  742.    {
  743.       if(!(com.mosesSupposes.fuse.Fuse._oBuildMode != null && com.mosesSupposes.fuse.Fuse._oBuildMode.curID > -1))
  744.       {
  745.          return false;
  746.       }
  747.       var _loc1_ = com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup == null ? com.mosesSupposes.fuse.Fuse.getInstance(com.mosesSupposes.fuse.Fuse._oBuildMode.curID) : com.mosesSupposes.fuse.Fuse._oBuildMode.curGroup;
  748.       if(args.length == 1 && typeof args[0] == "object")
  749.       {
  750.          _loc1_.push(args[0]);
  751.       }
  752.       else
  753.       {
  754.          _loc1_.push({__buildMode:true,tweenargs:args});
  755.       }
  756.       return true;
  757.    }
  758.    function normalizeIndex(indexOrLabel)
  759.    {
  760.       var _loc4_ = undefined;
  761.       if(typeof indexOrLabel == "string")
  762.       {
  763.          _loc4_ = -1;
  764.          var _loc3_ = 0;
  765.          while(_loc3_ < this.length)
  766.          {
  767.             if(this[_loc3_].label == String(indexOrLabel))
  768.             {
  769.                _loc4_ = _loc3_;
  770.                break;
  771.             }
  772.             _loc3_ = _loc3_ + 1;
  773.          }
  774.          if(_loc4_ == -1)
  775.          {
  776.             return null;
  777.          }
  778.       }
  779.       else
  780.       {
  781.          _loc4_ = Number(indexOrLabel);
  782.       }
  783.       if(_global.isNaN(_loc4_) == true || Math.abs(_loc4_) >= this.length)
  784.       {
  785.          return null;
  786.       }
  787.       if(_loc4_ < 0)
  788.       {
  789.          _loc4_ = Math.max(0,this.length + _loc4_);
  790.       }
  791.       return _loc4_;
  792.    }
  793.    static function registerInstance(s)
  794.    {
  795.       if(com.mosesSupposes.fuse.Fuse._aInstances == null)
  796.       {
  797.          com.mosesSupposes.fuse.Fuse._aInstances = new Array();
  798.       }
  799.       return com.mosesSupposes.fuse.Fuse._aInstances.push(s) - 1;
  800.    }
  801.    static function removeInstanceAt(id, isDestroyCall)
  802.    {
  803.       if(isDestroyCall != true)
  804.       {
  805.          com.mosesSupposes.fuse.Fuse(com.mosesSupposes.fuse.Fuse._aInstances[id]).destroy();
  806.       }
  807.       delete com.mosesSupposes.fuse.Fuse._aInstances[id];
  808.    }
  809. }
  810.